home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / src.zoo / src / move.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-17  |  1.3 KB  |  51 lines

  1. /*                        Copyright (c) 1987 Bellcore
  2.  *                            All Rights Reserved
  3.  *       Permission is granted to copy or use this program, EXCEPT that it
  4.  *       may not be sold for profit, the copyright notice must be reproduced
  5.  *       on copies, and credit should be given to Bellcore where it is due.
  6.  *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  */
  8. /*    $Header: move.c,v 1.1 89/03/17 08:21:17 sau Exp $
  9.     $Source: /m1/mgr.new/src/RCS/move.c,v $
  10. */
  11. static char    RCSid_[] = "$Source: /m1/mgr.new/src/RCS/move.c,v $$Revision: 1.1 $";
  12.  
  13. /* move a window */
  14.  
  15. #include "bitmap.h"
  16. #include <stdio.h>     /* temporary */
  17. #include "defs.h"
  18. #include "event.h"
  19.  
  20. int move_window()
  21.    {
  22.    int button;
  23.    int dx = BIT_WIDE(ACTIVE(border));
  24.    int dy = BIT_HIGH(ACTIVE(border));
  25.    int sx = ACTIVE(x0);
  26.    int sy = ACTIVE(y0);
  27.    register WINDOW *win;
  28.  
  29.    move_box(screen,mouse,&sx,&sy,dx,dy,0);
  30.  
  31.    /* adjust window state */
  32.  
  33.    mousex += sx-ACTIVE(x0);
  34.    mousey += sy-ACTIVE(y0);
  35.  
  36.    shape(sx,sy,dx,dy);
  37. #ifdef ALIGN
  38.    if (dx != BIT_WIDE(ACTIVE(border)) || dy != BIT_HIGH(ACTIVE(border)))
  39.       do_event(EVENT_SHAPE,active,E_MAIN);
  40.    else
  41. #endif
  42.       do_event(EVENT_MOVE,active,E_MAIN);
  43.  
  44.    /* wait till button is released */
  45.  
  46.    do {
  47.       button=mouse_get(mouse,&sx,&sy);
  48.       }
  49.    while (button!=0);
  50.    }
  51.